package salary.calculation.common.response;

import salary.calculation.common.enumerate.IResponseEnum;

public class PageResponse<T> extends BaseResponse{
    private PageResult<T> data;

    public PageResponse(PageResult<T> data) {
        super();
        this.data = data;
    }

    public PageResponse(int code, String msg) {
        super(code, msg);
    }

    public PageResponse(IResponseEnum responseEnum) {
        super(responseEnum);
    }

    public PageResponse(int code, String msg, PageResult<T> data) {
        super(code, msg);
        this.data = data;
    }

    public PageResponse(IResponseEnum responseEnum, PageResult<T> data) {
        super(responseEnum);
        this.data = data;
    }

    public PageResult<T> getData() {
        return data;
    }

    public void setData(PageResult<T> data) {
        this.data = data;
    }

    public static PageResponse newInstance(PageResult<Object> data) {
        return new PageResponse(data);
    }

    public static PageResponse newInstance(IResponseEnum responseEnum) {
        return new PageResponse(responseEnum);
    }

    @Override
    public String toString() {
        return "PageResponse{" +
                "data=" + data +
                "} " + super.toString();
    }
}
